package cn.wit.luohui.day12;

public class DemoThread {
	public static void main(String[] args) {
		//线程
		Thread thread=new Thread(new Runnable() {//匿名内部类

			@Override
			public void run() {
				System.out.println("异步线程。。。。");
				
			}
			
		});
		thread.start();//启动线程
		
		MyThread thread2=new MyThread();
		thread2.start();
//		Thread thread2=new Thread();
//		thread2.start();
//		
		
		//使用lambda表达式创建Runnable
		Thread thread3=new Thread(()-> { 
			System.out.println("lambda表达式创建线程。。。");
		});
		thread3.start();
		
		System.out.println("主线程执行。。。");
	}
	
}
class MyThread extends Thread {
	@Override
	public void run() {
		
		System.out.println("子线程在跑。。。");
		super.run();
	}
}
